package BookManagement.service;

import BookManagement.domain.Purchase;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

public interface PurchaseService {

    //添加购买记录
    public int purchase(Purchase purchase);

    //查找购买记录
    public List<Purchase> findAllPurchase(HashMap<String,Object> map);

    //根据书ISBN查找购买记录
    public List<Purchase> findAllPurchaseByBook(HashMap<String,Object> map);

    //根据用户查找购买记录
    public List<Purchase> findAllPurchaseByUser(HashMap<String,Object> map);

    //查找用户购买记录条数
    public int findPurchaseCountByUser(String username);

    //查找书本购买记录条数
    public int findPurchaseCountByBook(String bookISBN);

    //删除购买记录
    public int deletePurchase(String bookISBN,String username);
}
